#ifndef AF_ADDITEM_H
#define AF_ADDITEM_H

#include <head/g_pch.h>
#include <head/db_helper.h>
#include <head/m_message.h>
#include "m_fhs.h"

namespace Ui {
class AF_AddItem;
}

class AF_AddItem : public QDialog
{
    Q_OBJECT

public:
    explicit AF_AddItem(QWidget *parent = nullptr);
    ~AF_AddItem();

    void updateTypes();
    void updatePartners();
    void updateNames();
    void setDate(const QDate &date);
    void setItem(const QString &name,
                 const QString &number,
                 const QString &remark);

    bool addItem(const QString &type,
                 const QString &partner,
                 const QString &name,
                 int number,
                 const QString &remark);

private slots:
    void on_isMulti_stateChanged(int state);
    void on_btn_submit_clicked();
    void on_types_currentTextChanged(const QString &text);
    void on_partners_currentTextChanged(const QString &text);
    void on_names_currentTextChanged(const QString &text);

private:
    Ui::AF_AddItem *ui;

    QString table;
};

#endif // AF_ADDITEM_H
